// import request from 'umi-request';
import request from '@/utils/request';
import { TableListParams, FormItem } from './data.d';

//查询出口货款融资
export async function fetch(params: TableListParams) {
  return request(PORTAL_PATH + '/api/qianzhuang/loans', {
    params,
  });
}

//申请货款融资
export async function add(params: FormItem) {
  return request(PORTAL_PATH + '/api/loan', {
    method: 'POST',
    params,
  });
}

/**
 * 根据sprCode获取参数集合
 *
 * @param sprCode
 * @returns {Promise.<void>}
 */
export async function getBusinessParamsByCode({ sprCode }) {
  return request(BASEDATA_PATH + '/api/allBusinessParams', {
    method: 'GET',
    data: { sprCode }, 
  });
}

export async function getGoods(data) {
  return request(PORTAL_PATH + '/api/goods/type', {
    method: 'GET',
    data,
  });
}